# Maintainer: Antoni Aloy <aaloytorrens@gmail.com>
pkgname=lxqt-panel
pkgver=1.1.0
pkgrel=0
pkgdesc="The LXQt desktop panel"
url="https://github.com/lxqt/lxqt-panel"
arch="all !s390x !armhf !riscv64" # s390x blocked by solid, armhf by qt
license="LGPL-2.0-or-later"
subpackages="$pkgname-doc $pkgname-dev $pkgname-lang"
makedepends="
	cmake samurai lxqt-build-tools libsoundio-dev xcb-util-dev
	libstatgrab-dev pulseaudio-dev libxrender-dev
	libsysstat-dev lm-sensors-dev lxqt-globalkeys-dev
	liblxqt-dev libdbusmenu-qt-dev qt5-qttools-dev
	menu-cache-dev kwindowsystem-dev kguiaddons-dev
	solid-dev libxtst-dev xcb-util-image-dev
	"
options="!check" # No testsuite
source="https://github.com/lxqt/lxqt-panel/releases/download/$pkgver/lxqt-panel-$pkgver.tar.xz"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		$CMAKE_CROSSOPTS .
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

lang() {
	install_if="lang $pkgname=$pkgver-r$pkgrel"
	amove usr/share/lxqt/translations/$pkgname
}

sha512sums="
d112bb2a251c858f250fec34fab4392b070e5a1128155f1bb8ff1fa1d7189225624b2151b8d4beb19f12548c90b2a5892bd717ab5b8e2928271d2167c62aa053  lxqt-panel-1.1.0.tar.xz
"
